/** * Returns the maximum number from the provided arguments. * Mirrors the behavior of the built‑in Math.max: * - Returns -Infinity when called with no arguments. * - Returns NaN if any argument is NaN. * * @param {...number} numbers - A list of numbers to evaluate. * @returns {number} The greatest number, or -Infinity / NaN per Math.max semantics. */ export function max(...numbers) { // Delegating to the native Math.max ensures correct handling of edge cases // such as NaN propagation and Infinity handling. return Math.max(...numbers); }